8/23/2021

What is Plotly

Plotly is an open source Graphing Library works with a number of coding languages and is designed to make interactive graphs that can be displayed in HTML

It works with several coding languages:

  • R
  • Python
  • Java Script

In R

Calling the plotly package allows 2 main ways to create Plotly Graphics

  1. via GGPlot by passing a created ggplot to a function called ggplotly
  2. Via plotly’s own graphing process that is similar to ggplot

The Plotly Logo

GGPLOT vs Plotly Similarities

In R there are many similarities between how Plotly and GGPLOT charts are put together.

GGPLOT to Plotly Example

g <- ggplot(data = data)+aes(x=units.sold, y = income, color = wine,pch = type)+
  geom_point()+ggtitle("Example Plot")
ggplotly(g) %>% layout()

Directly in Plotly

plot_ly(data = data, x= ~units.sold, y= ~income,
        color = ~wine, symbol = ~type) %>% 
  layout(title = " A quick Plotly Graph")

Using multiple traces

plot_ly(data = data, x= ~factor(wine), y = ~income, type = 'scatter',
       name = 'scatterplot') %>% add_boxplot(name = "boxplot") %>% 
  layout(title = 'Layed Wine Chart')

Maps

Plotly also provides a large number of realtively easy options for creating maps via base data frames. Here are some of the options:

Buttons and Other Notes

Plotly, as part of the interactive promise, offers the ability to create additional items:

For a full list of graphing options and how to execute them visit: https://plotly.com/graphing-libraries/

The End

Kyle Walter IST719

Any Questions?